home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / lib / pm-utils / module.d / kernel next >
Text File  |  2008-10-15  |  581b  |  39 lines

  1. #!/bin/sh
  2.  
  3. check_suspend()
  4. {
  5.     grep -q mem /sys/power/state || [ -c /dev/pmu ]
  6. }
  7.  
  8. do_suspend()
  9. {
  10.     if grep -q mem /sys/power/state; then
  11.         echo -n "mem" > /sys/power/state
  12.     elif [ -c /dev/pmu ]; then
  13.         check_suspend_pmu && do_suspend_pmu
  14.     fi
  15. }
  16.  
  17. check_hibernate()
  18. {
  19.     [ -f /sys/power/disk ] && grep -q disk /sys/power/state
  20. }
  21.  
  22. do_hibernate()
  23. {
  24.     [ -n "${HIBERNATE_MODE}" ] && \
  25.     grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
  26.     echo -n "${HIBERNATE_MODE}" > /sys/power/disk
  27.     echo -n "disk" > /sys/power/state
  28. }
  29.  
  30. check_suspend_hybrid()
  31. {
  32.     return 1
  33. }
  34.  
  35. do_suspend_hybrid()
  36. {
  37.     return 1
  38. }
  39.